package lab03;

import java.io.*;

public class Test01 {
    public static void main(String[] args) {
        String path = "D:\\hello.txt";

        //一次读一行字符
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(path));
            String line = "";
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                reader.close();
            } catch (IOException e) {

                e.printStackTrace();
            }
        }
    }
}
